'''
Created on 22 janv. 2013

@author: tclain
'''

from instance.Errors import *
from model.Container import *
class Value(Container):
    '''
    class used to store a Value of a variable
    '''


    def __init__(self,rawstr):
        '''
        Constructor
        '''
        Container.__init__(self,rawstr)
        
        self._pname = None #le nom de la variable associée
        self._value = None
        
        splitted = rawstr.split(":")
        if len(splitted) == 0:
            pass
        name = ""
        defaultValue = ""
        
        if len(splitted) == 0 :
            raise VariableError
        if len(splitted) == 1 :
            name = rawstr
        else:
            if len(splitted) == 2 :
                name = splitted[0]
                defaultValue = splitted[1]
        
        self._name = name
        self._defaultValue = defaultValue
        
        